package com.lvzero.answer.controller;

import com.lvzero.answer.common.Result;
import com.lvzero.answer.service.QuestionsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 题目的controller
 */
@Api(tags = "题库模块")
@RestController
@CrossOrigin
@RequestMapping("api")
public class QuestionsController {

    @Autowired
    QuestionsService questionService;


    /**
     * 获取随机的10道题目
     * @return
     */
    @ApiOperation(value = "随机获取10道题目",httpMethod = "GET")
    @RequestMapping("questions")
    public Result getQuestions(){
        return questionService.getQuestions();
    }


}
